// Time: O(o(s) + o(t))
// Space: O(1)
// fix j, move i
class Solution {
public:
    bool isSubsequence(string s, string t) {
        int i = 0, j = 0;
        while (j < t.size()) {
            if (s[i] == t[j])
                ++i;
            ++j;
        }
        return i == s.size();
    }
};
